package com.weng.platform.resource.api;

import com.qiniu.util.Auth;
import com.weng.framework.core.model.ResponseData;
import com.weng.framework.web.base.BaseController;
import com.weng.platform.resource.service.IResourceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 资源信息 API实现
 *
 * @author weng
 * @date 2021-03-01 16:29:08
 *
 */  
@Slf4j
@RestController
@RequestMapping("/qiniu")
@Api(value = "资源信息api", tags = {"资源信息操作接口"})
public class QiniuApi extends BaseController {
    @Autowired
    private IResourceService resourceService;

    /**
     * 功能描述:单个获取资源信息
     */
    @ApiOperation(value = "获取资源信息", notes = "")
    @GetMapping(value = "/token")
    public ResponseData get(){
				String accessKey = "w4Arpn5ESTaIeJd0r1UaMSwwEbkz7ebBv4-VmomX";
				String secretKey = "0aG9JuAMrRe4mSy_D1K3a7VjGlBquLiMUXL9jPvZ";
				String bucket = "mathjunior";
				Auth auth = Auth.create(accessKey, secretKey);
				String upToken = auth.uploadToken(bucket);
        return success(upToken);
    }



}
